/**
 * 玩家飞船类
 */
import { Component } from '../core/ecs';

export interface PlayerShip extends Component {
  health: number;
  fireRate: number; // 秒/发
  moveSpeed: number; // 像素/秒
  maxHealth: number;
}

export const PlayerShip = (): PlayerShip => ({
  health: 100,
  fireRate: 0.3,
  moveSpeed: 480,
  maxHealth: 100
});

/**
 * 敌机类型定义
 */
export interface EnemyShip extends Component {
  type: 'scout' | 'destroyer' | 'mothership';
  health: number;
  moveSpeed: number;
  fireRate: number;
  damage: number;
  score: number;
}

export const ScoutShip = (): EnemyShip => ({
  type: 'scout',
  health: 25,
  moveSpeed: 200,
  fireRate: 1.5,
  damage: 10,
  score: 100
});

export const DestroyerShip = (): EnemyShip => ({
  type: 'destroyer',
  health: 75,
  moveSpeed: 120,
  fireRate: 0.8,
  damage: 20,
  score: 300
});

export const MotherShip = (): EnemyShip => ({
  type: 'mothership',
  health: 200,
  moveSpeed: 60,
  fireRate: 0.5,
  damage: 30,
  score: 1000
});